/*
 * @Author: ls
 * @Date: 2021-10-14 14:00:19
 * @LastEditTime: 2021-10-14 15:06:00
 * @LastEditors: Please set LastEditors
 * @Description: 子弹3
 * @FilePath: \Alive-master\assets\script\game\bullet\bullet_3.ts
 */

import { BulletBase } from './bulletBase';
const { ccclass, property } = cc._decorator;

@ccclass
export class Bullet_3 extends BulletBase {
	/** 收缩方向 */
	private _scaleDir: number = 1;

	update(dt: number): void {
		super.update(dt);

		if (this.node.scaleX > 1.3) {
			this._scaleDir = -1;
		} else if (this.node.scaleX < 1) {
			this._scaleDir = 1;
		}
		this.node.scale += this._scaleDir * dt * 5; // 收缩
	}
}
